package qf.sail.controller;

import qf.sail.service.GoodService;
import qf.sail.service.impl.GoodServiceImpl;
import qf.sail.vo.ResultVO;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/getMaxSalesList")
public class GetMaxSalesGoodListServlet extends BaseServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        GoodService goodService = new GoodServiceImpl();
        ResultVO resultVO = new ResultVO();
        resultVO.addData("hotGoods",goodService.getMaxSalesGood(6));
        resultVO.addData("malesGoods",goodService.getMaxSalesGood(8,2));
        resultVO.addData("manGoods",goodService.getMaxSalesGood(8,1));
        repSuccess(resp,resultVO);
    }
}
